package org.springblade.modules.admin.controller.suger;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.core.tool.api.R;
import org.springblade.modules.admin.dto.PlanCheckStatisticsQueryDTO;
import org.springblade.modules.admin.service.BuildingService;
import org.springblade.modules.admin.vo.sugar.PieChartVO;
import org.springblade.modules.admin.vo.sugar.ProjectOverviewVO;
import org.springframework.web.bind.annotation.*;

/**
 * @Description 大屏-维保项目
 * @Author ysq
 * @Date 2022/10/12
 **/
@RestController
@RequestMapping("/admin/project/screen")
@AllArgsConstructor
@Api(value = "大屏-维保项目", tags = "大屏-维保项目")
public class ProjectScreenController {

	private final BuildingService buildingService;

	@GetMapping("/overview")
	@ApiOperation(value = "大屏-维保项目-项目总览")
	public R<ProjectOverviewVO> projectOverview() {
		return R.data(buildingService.projectOverview());
	}

	@GetMapping("/comingExpiryProject")
	@ApiOperation(value = "大屏-维保项目-即将到期项目")
	public R<PieChartVO> comingExpiryProject() {
		return R.data(buildingService.comingExpiryProject());
	}

	@PostMapping("/projectElevator")
	@ApiOperation(value = "大屏-维保项目-即将到期项目-总体项目分布情况")
	public R<PieChartVO> projectElevator(@RequestBody PlanCheckStatisticsQueryDTO queryDTO) {
		return R.data(buildingService.projectElevator(queryDTO));
	}
}
